06. Localization: Map

Adding a map

So far, you have created a robot model from scratch, added sensors to it to visualize its surroundings, and developed a package for this robot to launch it in a simulated environment. That's a great amount of work you have accomplished!

But, what surroundings is your robot currently sensing? And how would you go about localizing the robot if you don't know where you wish to localize it?

In this section, you will launch your robot in a new environment using a map created by Clearpath Robotics.

We will start with creating a new folder in the package directory.

$ cd /home/workspace/catkin_ws/src/udacity_bot/
$ mkdir maps
$ cd maps

You can then copy the two files jackal_race.pgm and jackal_race.yaml from the project repo into the “maps” folder.

Note: The .pgm file is quite large and may cause the VM or local system to freeze if opened.

Earlier on in this lesson, you created an empty Gazebo world, called udacity.world. The map that you will be working with is generated based on its own world.

$ cd ..
$ cd worlds

Copy the file jackal_race.world from the project repo into the “worlds” folder.

Next, you will have to modify the udacity_world.launch file and update the path to this new map/world.

$ cd ..
$ cd launch/
$ nano udacity_world.launch

Modify the argument world_name such that it points to jackal_race.world. You are now ready to launch your robot in this new map!

$ cd /home/workspace/catkin_ws/
$ roslaunch udacity_bot udacity_world.launch

*Note: * As of this step, you won’t see the map in RViz.